package com.dq.controller.user;

import com.dq.controller.in.user.UserAnonymousQuery;
import com.dq.domain.org.Org;
import com.dq.domain.sys.user.user.centre.UserAnonymous;
import com.dq.exception.customException.AdminException;
import com.dq.service.AllService;
import com.dq.vo.ListDataVo;
import com.dq.vo.Vo;
import com.dq.vo.baseVo.VO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author cf
 */

@RestController
@RequestMapping("/sys/userAnonymous/")
@Api(description = "匿名信管理")
public class SysUserAnonymousController extends AllService {

    @PostMapping("list")
    @ApiOperation("匿名信列表")
    public Vo list(@RequestBody UserAnonymousQuery userAnonymousQuery)throws AdminException {

        List<UserAnonymous> list = userAnonymousService.list(userAnonymousQuery);
        return new ListDataVo((List<UserAnonymous.Vo>) VO.toVOCollection(list), userAnonymousService.count(userAnonymousQuery));

    }

}
